package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  GamePlayers.java
 * Author:  Rojko
 * Purpose: Defines the Class GamePlayers
 ***********************************************************************/

import java.util.*;

/** @pdOid 60b85eb9-46e0-4a87-adf1-305fd092b99e */
public class GamePlayers {
   /** @pdRoleInfo migr=no name=Scores assc=playerScore coll=java.util.Collection impl=java.util.HashSet mult=0..* */
   public java.util.Collection<Scores> scores;
   /** @pdRoleInfo migr=no name=GamePenalties assc=relationship13 coll=java.util.Collection impl=java.util.HashSet mult=0..* type=Composition */
   public java.util.Collection<GamePenalties> gamePenalties;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<Scores> getScores() {
      if (scores == null)
         scores = new java.util.HashSet<Scores>();
      return scores;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorScores() {
      if (scores == null)
         scores = new java.util.HashSet<Scores>();
      return scores.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newScores */
   public void setScores(java.util.Collection<Scores> newScores) {
      removeAllScores();
      for (java.util.Iterator iter = newScores.iterator(); iter.hasNext();)
         addScores((Scores)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newScores */
   public void addScores(Scores newScores) {
      if (newScores == null)
         return;
      if (this.scores == null)
         this.scores = new java.util.HashSet<Scores>();
      if (!this.scores.contains(newScores))
         this.scores.add(newScores);
   }
   
   /** @pdGenerated default remove
     * @param oldScores */
   public void removeScores(Scores oldScores) {
      if (oldScores == null)
         return;
      if (this.scores != null)
         if (this.scores.contains(oldScores))
            this.scores.remove(oldScores);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllScores() {
      if (scores != null)
         scores.clear();
   }
   /** @pdGenerated default getter */
   public java.util.Collection<GamePenalties> getGamePenalties() {
      if (gamePenalties == null)
         gamePenalties = new java.util.HashSet<GamePenalties>();
      return gamePenalties;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorGamePenalties() {
      if (gamePenalties == null)
         gamePenalties = new java.util.HashSet<GamePenalties>();
      return gamePenalties.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newGamePenalties */
   public void setGamePenalties(java.util.Collection<GamePenalties> newGamePenalties) {
      removeAllGamePenalties();
      for (java.util.Iterator iter = newGamePenalties.iterator(); iter.hasNext();)
         addGamePenalties((GamePenalties)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newGamePenalties */
   public void addGamePenalties(GamePenalties newGamePenalties) {
      if (newGamePenalties == null)
         return;
      if (this.gamePenalties == null)
         this.gamePenalties = new java.util.HashSet<GamePenalties>();
      if (!this.gamePenalties.contains(newGamePenalties))
         this.gamePenalties.add(newGamePenalties);
   }
   
   /** @pdGenerated default remove
     * @param oldGamePenalties */
   public void removeGamePenalties(GamePenalties oldGamePenalties) {
      if (oldGamePenalties == null)
         return;
      if (this.gamePenalties != null)
         if (this.gamePenalties.contains(oldGamePenalties))
            this.gamePenalties.remove(oldGamePenalties);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllGamePenalties() {
      if (gamePenalties != null)
         gamePenalties.clear();
   }

}